<?php
class AdEditMenu extends Portlet
{
	public $id;
	public $status;
	public $balance;
	
	public function init()
	{
		$this->htmlOptions = array();
		parent::init();
	}
	
	protected function renderContent()
	{
		echo CHtml::openTag('ul');
		echo CHtml::openTag('li',array('class'=>'edit'));
		echo CHtml::link(Yii::t('adv','edit'),Yii::app()->createUrl('adv/edit/',array('ad_id'=>$this->id)));
		echo CHtml::closeTag('li');
		echo CHtml::openTag('li',array('class'=>'changeStatus '.$this->status));
		echo CHtml::image('/img/ads/'.$this->status.'.gif','',array('class'=>'ad_status_em'));
		echo CHtml::tag('span',array('class'=>'ad_status_em capitalize'),Yii::t('adv', $this->status));
		if(in_array($this->status,array('active','paused'))){
			echo '&nbsp;&nbsp;'.CHtml::link(Yii::t('adv','status_edit'),Yii::app()->createUrl('adv/ad_status_edit/',array('ad_id'=>$this->id)),array('class'=>'ad_status_edit'));
		}
		echo CHtml::closeTag('li');
		echo CHtml::openTag('li',array('class'=>'deposit'));
		echo Yii::t('adv','balance').$this->balance.'&nbsp;&nbsp;';
		echo CHtml::link(Yii::t('adv','add'),Yii::app()->createUrl('adv/deposit/',array('ad_id'=>$this->id)));
		echo CHtml::closeTag('li');
		echo CHtml::openTag('li',array('class'=>'slogans'));
		echo CHtml::link(Yii::t('adv','view'),Yii::app()->createUrl('copy/ad/',array('ad_id'=>$this->id)));
		echo CHtml::closeTag('li');
		echo CHtml::closeTag('ul');
	}
}